package test;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.apache.commons.dbcp.BasicDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import collector.Collector;
import collector.NetCollector;
import render.PieRender;
import render.Render;
import service.WorkService;

public class action {
	public static void main(String[] args) throws SQLException {
		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//		Render r = (Render)context.getBean("line");
//		r.render();
		
//		Collector c1 = context.getBean(Collector.class);
//		NetCollector nc  = (NetCollector)c1;
//		System.out.println(nc.getCname());
		
//		Render r1 = context.getBean(Render.class);
//		r1.render();
//		DataSource ds = (DataSource)context.getBean("dataSource1");
//		System.out.println(ds.getConnection());
		WorkService ws  = (WorkService)context.getBean("ws");
		ws.work("ziv");
	}
}
